package fun.formoji.admin.controller;

import fun.formoji.alg.api.OfflineAlgApi;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: h
 * @Date: 2022/8/13 21:18
 */
@RestController
@RequestMapping("/admin")
@Api(tags = "admin接口")
public class AdminController {

    @Autowired
    private final OfflineAlgApi offlineAlgApi;

    public AdminController(OfflineAlgApi offlineAlgApi) {
        this.offlineAlgApi = offlineAlgApi;
    }
    @GetMapping("/alg")
    @ApiOperation("调用算法接口")
    public Object algInfo(@RequestParam String aId) {
        //远程调用alg
        return offlineAlgApi.couponScore(aId);
    }
}
